#ifndef  CONNECTION_H
#define  CONNECTION_H

#include <string>
#include <rcssnet/tcpsocket.hpp>
#include <rcssnet/exception.hpp>
#include <netinet/in.h>
#include <boost/shared_ptr.hpp>

#include <tsubamegaeshi-base/soccerbotbehavior.h>
#include <tsubamegaeshi-base/behavior.h>

class Connection {
  rcss::net::TCPSocket socket_;
  std::string host_;
  int port_;

public:
  typedef boost::shared_ptr< Connection > shared_ptr;
  Connection(std::string host, int port);
  ~Connection();

  const std::string& host() { return host_; }
  const int port() { return port_; }
  void put_message(const std::string& msg);
  bool get_message(std::string& msg);
  bool select_input();
  void close();
};


#endif//CONNECTION_H
